﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Advisor.Entities
{
  public class EntitiesFC
  {
    private Users m_Users;
    public EntitiesFC(Users user)
    {
      this.m_Users = user;
    }

    #region History
    public IList GetHistories()
    {
      HistoryDAO dao = new HistoryDAO(this.m_Users);
      IList histories = dao.GetHistories("", 1000, 0);
      return histories;
    }

    public History GetHistory(int id)
    {
      HistoryDAO dao = new HistoryDAO(this.m_Users);
      History history = dao.GetHistory(id);
      return history;
    }

    public void InsertHistory(History history)
    {
      HistoryDAO dao = new HistoryDAO(this.m_Users);
      dao.InsertHistory(history);
    }

    public void UpdateHistory(History history)
    {
      HistoryDAO dao = new HistoryDAO(this.m_Users);
      dao.UpdateHistory(history);
    }

    public void DeleteHistory(History history)
    {
      HistoryDAO dao = new HistoryDAO(this.m_Users);
      dao.DeleteHistory(history);
    }

    #endregion

    #region Members
    public IList GetMembers(FilterCollection filters)
    {
      MembersDAO dao = new MembersDAO(this.m_Users);
      IList members = dao.GetMembers(filters);
      return members;
    }

    public Members GetMember(FilterCollection filters)
    {
      MembersDAO dao = new MembersDAO(this.m_Users);
      Members member = dao.GetMember(filters);
      return member;
    }

    public void InsertMember(Members member)
    {
      MembersDAO dao = new MembersDAO(this.m_Users);
      dao.InsertMember(member);
    }

    public void UpdateMember(Members member)
    {
      MembersDAO dao = new MembersDAO(this.m_Users);
      dao.UpdateMember(member);
    }

    public void DeleteMember(Members member)
    {
      MembersDAO dao = new MembersDAO(this.m_Users);
      dao.DeleteMember(member);
    }
    #endregion

    #region MembersProject
    public IList GetMembersProject()
    {
      MembersProjectDAO dao = new MembersProjectDAO(this.m_Users);
      IList membersProject = dao.GetMembersProjects("", 1000, 0);
      return membersProject;
    }

    public Membersprojectmappings GetMemberProject(int id)
    {
      MembersProjectDAO dao = new MembersProjectDAO(this.m_Users);
      Membersprojectmappings membersProject = dao.GetMemberProject(id);
      return membersProject;
    }

    public void InsertHistory(Membersprojectmappings membersProject)
    {
      MembersProjectDAO dao = new MembersProjectDAO(this.m_Users);
      dao.InsertMemberProject(membersProject);
    }

    public void UpdateHistory(Membersprojectmappings membersProject)
    {
      MembersProjectDAO dao = new MembersProjectDAO(this.m_Users);
      dao.UpdateMembersProject(membersProject);
    }

    public void DeleteHistory(Membersprojectmappings membersProject)
    {
      MembersProjectDAO dao = new MembersProjectDAO(this.m_Users);
      dao.DeleteMembersProject(membersProject);
    }
    #endregion

    #region Users

    public IList GetUsers(FilterCollection filters)
    {
      UserDAO dao = new UserDAO(this.m_Users);
      IList Users = dao.GetUsers(filters);
      return Users;
    }

    public Users GetUser(FilterCollection filters)
    {
      UserDAO dao = new UserDAO(this.m_Users);
      Users user = dao.GetUser(filters);
      return user;
    }

    public void InsertUser(Users user)
    {
      UserDAO dao = new UserDAO(this.m_Users);
      dao.InsertUser(user);
    }

    public void UpdateUser(Users user)
    {
      UserDAO dao = new UserDAO(this.m_Users);
      dao.UpdateUser(user);
    }

    public void DeleteUser(Users user)
    {
      UserDAO dao = new UserDAO(this.m_Users);
      dao.DeleteUser(user);
    }
    #endregion

      #region Project

    public IList GetProjects(FilterCollection filters)
    {
        ProjectDAO dao = new ProjectDAO(this.m_Users);
        IList Projects = dao.GetProjects(filters);
        return Projects;
    }

    public Project GetProject(FilterCollection filters)
    {
        ProjectDAO dao = new ProjectDAO(this.m_Users);
        Project Project = dao.GetProject(filters);
        return Project;
    }

    public void InsertProject(Project project)
    {
        ProjectDAO dao = new ProjectDAO(this.m_Users);
        dao.InsertProject(project);
    }

    public void UpdateProject(Project project)
    {
        ProjectDAO dao = new ProjectDAO(this.m_Users);
        dao.UpdateProject(project);
    }

    public void DeleteProject(Project project)
    {
        ProjectDAO dao = new ProjectDAO(this.m_Users);
        dao.DeleteProject(project);
    }

      #endregion

      #region Risk

    public IList GetRisks(FilterCollection filters)
    {
        RiskDAO dao = new RiskDAO(this.m_Users);
        IList Risks = dao.GetRisks(filters);
        return Risks;
    }

    public Risk GetRisk(FilterCollection filters)
    {
        RiskDAO dao = new RiskDAO(this.m_Users);
        Risk Risk = dao.GetRisk(filters);
        return Risk;
    }

    public void InsertRisk(Risk risk)
    {
        RiskDAO dao = new RiskDAO(this.m_Users);
        dao.InsertRisk(risk);
    }

    public void UpdateRisk(Risk risk)
    {
        RiskDAO dao = new RiskDAO(this.m_Users);
        dao.UpdateRisk(risk);
    }

    public void DeleteRisk(Risk risk)
    {
        RiskDAO dao = new RiskDAO(this.m_Users);
        dao.DeleteRisk(risk);
    }


      #endregion


  }
}
